<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <#include "/pubHeadStyle.html">
</head>
<body>
<div>
    <table id="fieldTableList" lay-filter="fieldTableList"></table>
</div>
<div class="layui-btn-container" style="position: absolute;bottom: 0;left:45%">
    <a class="layui-btn" id="select">选择</a>
    <a class="layui-btn layui-btn-danger" id="cancel">取消</a>
</div>
<script>
    layui.config({
        base: serverPath.formPath + staticPath.formPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index', 'table', 'layer', 'jquery', 'commons', 'form', 'setter'], function () {
        var table = layui.table,
            layer = layui.layer,
            form = layui.form,
            $ = layui.jquery,
            setter = layui.setter,
            commons = layui.commons;
        form.render();

        table.render({
            elem: '#fieldTableList',
            method: 'post',
            url: serverPath.formPath + setter.formLinkPath +'table/fieldList',
            height: 'full-74',
            where: {formKey:'${formKey}'},
            cols: [
                [
                    {type: 'radio'},
                    {field: 'fieldDesc', title: '字段描述', align:'center', sort: false},
                    {field: 'fieldName', title: '字段代码',align:'center', sort: false},
                    {field: 'fieldType', align:'center', title: '字段类型',sort: false}
                ]
            ],
            done: function () {


            }
        });
        var selectFiledName;
        table.on('radio(fieldTableList)', function (obj) {
            var data = obj.data;
            selectFiledName = data.fieldName;
        });

        $("#select").click(function () {
            parent.setFieldName(selectFiledName);
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        });

        $("#cancel").click(function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        });
    });


</script>
</body>
</html>